import { defineUserConfig } from "vuepress";
import { hopeTheme } from "vuepress-theme-hope";

// const { backToTopPlugin } = require('@vuepress/plugin-back-to-top')
// const { nprogressPlugin } = require('@vuepress/plugin-nprogress')
import { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom';
import { searchPlugin } from '@vuepress/plugin-search';

export default defineUserConfig({
  title: 'i2UP接口文档',
  description: '控制台接口说明文档',
  base: '/i2up-docs/',
  head: [
    ['link', { rel: 'icon', href: '/logo_mini.png' }]
  ],
  port: 8888,
  dest: '.vuepress/i2up-docs',
  // lang: "zh-CN",
  shouldPrefetch: false,
  theme: hopeTheme({
    hostname: 'i2UP接口文档',
    logo: '/logo_mini.png',
    lastUpdated: true,
    plugins: {
      pwa: false,
      seo: false,
      feed: false,
      sitemap: false,
      comment: false,
      // category: false,
      // tag: false,
      // archive: false,
    },
    navbar: [
      {
        text: '接口说明',
        children: [
          { text: '7.1.xx (20221118)', link: '/apiref/7.1.76/' },
          { text: '7.1.xx (20220926)', link: '/apiref/7.1.76.1/' },
          { text: '7.1.74 (20210819)', link: '/apiref/7.1.74/' },
          { text: '7.1.72 (20210819)', link: '/7.1.72/apiref/' }
        ]
      },
      {
        text: 'SDK说明',
        children: [
          { text: '7.1.X', link: '/sdkspec/' },
          { text: '7.1.72', link: '/7.1.72/sdkspec/' },
          { text: '7.1.70', link: '/7.1.70/sdkspec/' },
          { text: '7.1.68', link: '/7.1.68/sdkspec/' },
          { text: '7.1.58', link: '/7.1.58/sdkspec/' },
          { text: '7.1.57', link: '/7.1.57/sdkspec/' },
          { text: '7.1.53', link: '/7.1.53/sdkspec/' }
        ]
      },
      {
        text: 'SDK下载',
        children: [
          { text: 'JAVA(gitee)', link: 'https://gitee.com/i2soft/i2up-java-sdk' },
          { text: 'Python(gitee)', link: 'https://gitee.com/i2soft/i2up-python-sdk' },
          { text: 'JAVA', link: 'https://github.com/info2soft/i2up-java-sdk' },
          { text: 'Python', link: 'https://github.com/info2soft/i2up-python-sdk' },
          { text: 'PHP', link: 'https://github.com/info2soft/i2up-php-sdk' }
        ]
      },
      {
        text: '历史版本',
        children: [
          // { text: '7.1.76', link: '/apiref/7.1.76/' },
          // { text: '7.1.74', link: '/apiref/7.1.74/' },
          { text: '7.1.72', link: '/7.1.72/' },
          { text: '7.1.70', link: '/7.1.70/' },
          { text: '7.1.68', link: '/7.1.68/' },
          { text: '7.1.58', link: '/7.1.58/' },
          { text: '7.1.57', link: '/7.1.57/' },
          { text: '7.1.53', link: '/7.1.53/' }
        ]
      },
      { text: '官网', link: 'https://www.info2soft.com' },
    ],
    sidebar: "heading",

  }),
  plugins: [
    [
      // backToTopPlugin(),
      mediumZoomPlugin({
        // 配置项
      }),
      searchPlugin({
        // 你的选项
      }),
      // nprogressPlugin(),
      (pluginOptions, context) => ({
        name: 'my-xxx-plugin'
        // ... the rest of options
      })
    ]
  ]
});
